import React, { Component } from 'react';
import { StyleSheet, View, Text } from 'react-native';
import { px2dp } from '../../../common/styles';
import LinearGradient from 'react-native-linear-gradient';

/**
 * @modifyAuthor kanglang
 * @description 联盟运力卡片
 * @createDate 2020/8/24
 */

export default class LmylCard extends Component {

    constructor(props) {
        super(props);
        this.state = {}

    }

    render() {
        const { style, linearColors, titleOne, titleTwo } = this.props;
        return (
            <View style={[styles.ylCardWrap, style]}>
                <View style={styles.onePart}>
                    <LinearGradient
                        start={{ x: 0., y: 0 }} end={{ x: 1, y: 0 }}
                        colors={linearColors ? linearColors : ['#76DEFF', '#38B1FC',]}
                        style={styles.linearStyle}
                    >
                    </LinearGradient>
                    <Text numberOfLines={1} style={styles.titleOneStyle}
                    >{titleOne}</Text>
                </View>
                <Text style={styles.titleTwoStyle}>{titleTwo}</Text>
            </View>
        );
    }


}
const styles = StyleSheet.create({
    ylCardWrap: {
        flex: 1,
        backgroundColor: '#fff',
        borderRadius: px2dp(6) * 2,
        paddingBottom: px2dp(12) * 2,
        paddingTop: px2dp(12) * 2,
        shadowColor: 'rgba(0, 0, 0, 0.05)',
        shadowOffset: {
            width: 0,
            height: 2
        },
        shadowRadius: 6,
        elevation: 2,
    },
    onePart: {
        flexDirection: 'row',
        alignItems: 'center'
    },
    linearStyle: {
        width: px2dp(8),
        height: px2dp(37)
    },
    titleOneStyle: {
        color: '#333232',
        fontSize: px2dp(28) * 2,
        paddingLeft: px2dp(12) * 2,
    },
    titleTwoStyle: {
        color: '#999896',
        fontSize: px2dp(12) * 2,
        marginLeft: px2dp(20) * 2
    }

});
